const Mock = require("mockjs");

// http://mockjs.com/examples.html#Array

const records = Mock.mock({
  code: 1,
  "data|5-10": [
    {
      "id|+1": 1,
      create_time: "@datetime('yyyy-MM-dd HH:mm:ss')",
      status: "@integer(0, 2)",
      type: "@integer(1, 2)",
      apply_money: "@float(1, 10, 1)",
      update_time: "@datetime('yyyy-MM-dd HH:mm:ss')"
    }
  ]
});

module.exports = app => {
  app.get("/mock/user/records", (req, res) => {
    res.json(records);
  });
};
